\(\int \frac {\cot (x)}{a+b \csc (x)} \, dx\) [15]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 19 \[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\frac {\log (a+b \csc (x))}{a}+\frac {\log (\sin (x))}{a} \]

[Out]

ln(a+b*csc(x))/a+ln(sin(x))/a

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {3970, 36, 29, 31} \[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\frac {\log (a+b \csc (x))}{a}+\frac {\log (\sin (x))}{a} \]

[In]

Int[Cot[x]/(a + b*Csc[x]),x]

[Out]

Log[a + b*Csc[x]]/a + Log[Sin[x]]/a

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,b \csc (x)\right ) \\ & = -\frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,b \csc (x)\right )}{a}+\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \csc (x)\right )}{a} \\ & = \frac {\log (a+b \csc (x))}{a}+\frac {\log (\sin (x))}{a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.58 \[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\frac {\log (b+a \sin (x))}{a} \]

[In]

Integrate[Cot[x]/(a + b*Csc[x]),x]

[Out]

Log[b + a*Sin[x]]/a

Maple [A] (verified)

Time = 0.35 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11

method result size
derivativedivides \(-\frac {\ln \left (\csc \left (x \right )\right )}{a}+\frac {\ln \left (a +b \csc \left (x \right )\right )}{a}\) \(21\)
default \(-\frac {\ln \left (\csc \left (x \right )\right )}{a}+\frac {\ln \left (a +b \csc \left (x \right )\right )}{a}\) \(21\)
risch \(-\frac {i x}{a}+\frac {\ln \left ({\mathrm e}^{2 i x}-1+\frac {2 i b \,{\mathrm e}^{i x}}{a}\right )}{a}\) \(33\)

[In]

int(cot(x)/(a+b*csc(x)),x,method=_RETURNVERBOSE)

[Out]

-1/a*ln(csc(x))+ln(a+b*csc(x))/a

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.58 \[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\frac {\log \left (a \sin \left (x\right ) + b\right )}{a} \]

[In]

integrate(cot(x)/(a+b*csc(x)),x, algorithm="fricas")

[Out]

log(a*sin(x) + b)/a

Sympy [F]

\[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\int \frac {\cot {\left (x \right )}}{a + b \csc {\left (x \right )}}\, dx \]

[In]

integrate(cot(x)/(a+b*csc(x)),x)

[Out]

Integral(cot(x)/(a + b*csc(x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.58 \[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\frac {\log \left (a \sin \left (x\right ) + b\right )}{a} \]

[In]

integrate(cot(x)/(a+b*csc(x)),x, algorithm="maxima")

[Out]

log(a*sin(x) + b)/a

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.63 \[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\frac {\log \left ({\left | a \sin \left (x\right ) + b \right |}\right )}{a} \]

[In]

integrate(cot(x)/(a+b*csc(x)),x, algorithm="giac")

[Out]

log(abs(a*sin(x) + b))/a

Mupad [B] (verification not implemented)

Time = 18.76 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.89 \[ \int \frac {\cot (x)}{a+b \csc (x)} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {a\,\left (2\,b^3\,\sin \left (x\right )+\frac {5\,a\,b^2}{2}-a^3-\frac {a\,b^2\,\cos \left (2\,x\right )}{2}\right )}{{\left (-a^2+\sin \left (x\right )\,a\,b+2\,b^2\right )}^2}\right )}{a} \]

[In]

int(cot(x)/(a + b/sin(x)),x)

[Out]

(2*atanh((a*(2*b^3*sin(x) + (5*a*b^2)/2 - a^3 - (a*b^2*cos(2*x))/2))/(2*b^2 - a^2 + a*b*sin(x))^2))/a